-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: evacuation screen and small refactor of file structure in digit… #489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 21 changed files in this pull request and generated no comments.
Files not reviewed (19)
- lib/config/ui_config.dart: Language not supported
- lib/features/digital_guide_view/data/models/digital_guide_response.dart: Language not supported
- lib/features/digital_guide_view/data/models/digital_guide_response_extended.dart: Language not supported
- lib/features/digital_guide_view/data/repository/digital_guide_repository.dart: Language not supported
- lib/features/digital_guide_view/presentation/digital_guide_view.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/accessibility_button.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/digital_guide_data_source_link.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/digital_guide_features_section.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/digital_guide_go_to_button.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/headlines_section.dart: Language not supported
- lib/features/digital_guide_view/presentation/widgets/report_change_button.dart: Language not supported
- lib/features/digital_guide_view/tabs/amenities/presentation/amenities_expansion_tile_content.dart: Language not supported
- lib/features/digital_guide_view/tabs/entraces/data/models/digital_guide_entrace.dart: Language not supported
- lib/features/digital_guide_view/tabs/entraces/data/repository/entraces_repository.dart: Language not supported
- lib/features/digital_guide_view/tabs/evacuation/evacuation_widget.dart: Language not supported
- lib/features/digital_guide_view/tabs/models/digital_guide_entrace.dart: Language not supported
- lib/features/digital_guide_view/tabs/surrounding/data/repository/surrounding_repository.dart: Language not supported
- lib/features/digital_guide_view/tabs/surrounding/presentation/surroundings_expansion_tile_content.dart: Language not supported
- lib/features/navigator/app_router.dart: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job Tomuś!
I like the file structure. Only thing is that you have some duplicate trash files in my opinion, DigitalGuideEntrace
models are twice in the filesystem and the LocalizationExpansionTileContent
inside localization
in not in the tabs
. Rest look good.
Few notes left, one is a big missing one from the previous @24bartixx big PR - idk how I missed that.
I also propose to create a separate evacutation repo, but not sure if I got everything right (didn't study the responses in very much detail)
Tell me what you think!
lib/features/digital_guide_view/data/repository/digital_guide_repository.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/data/repository/digital_guide_repository.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/presentation/widgets/digital_guide_go_to_button.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/models/digital_guide_entrace.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/presentation/widgets/digital_guide_go_to_button.dart
Outdated
Show resolved
Hide resolved
lib/features/digital_guide_view/tabs/entraces/data/models/digital_guide_entrace.dart
Outdated
Show resolved
Hide resolved
I can't create separate repo for evacuation because evacuation is a property of building( buildings endpoint). |
Your evacuation repo can use the building data provider: @riverpod
Future<EvacuationModel> evacuationRepo(Ref ref, int id) async {
final building = await ref.watch(getDigitalGuideDataProvider(id).future);
final evacuationMapUrl =
await ref.watch(getImageUrlProvider(building.evacuationMapId).future);
// ...
//...
//...
return EvacuationModel(
//...
);
} or am i wrong? |
Now I understand |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so at the moment you're loading everything at first load and I would consider if loading things should happen when we open the proper extension tile. imo we should do things as lazy as possible. but we can merge it now and correct in next pr too
and before we make a review, please resolve conflicts to reduce diff size |
30c0889
to
66b6c16
Compare
66b6c16
to
0dd6eb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically LGTM, still I would maybe at least test the behaviour in case where we would only download this things when we open the specific tab and not all at first load, cause with time this is gonna be a lot of requests. But this require some repository rearranging - and maybe I'll handle this when I have a moment (someone else also can :P)
Merging this for now.
lib/widgets/my_error_widget.dart
Outdated
@@ -14,6 +14,8 @@ import "../features/parkings_view/widgets/offline_parkings_view.dart"; | |||
import "../gen/assets.gen.dart"; | |||
import "../theme/app_theme.dart"; | |||
|
|||
// MEGA TEST NICE // TODO(simon-the-shark): delete this comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you was supposed to delete this comment 😭
import "../models/digital_guide_response.dart"; | ||
import "../models/digital_guide_response_extended.dart"; | ||
|
||
part "digital_guide_repository.g.dart"; | ||
|
||
@riverpod | ||
Future<DigitalGuideResponseExtended> getDigitalGuideData( | ||
Future<DigitalGuideResponseExtended> getDigitalGuideDataExtended( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know who changed the convention, but I liked "digitalGuideRepository' convention more than 'getX' - but maybe that's just me
I refactored file structure a little bit. I decided to do this in tab (not in another screen) because when it's look more consistent. I know it's not the best practice in ux, but I think not many people will use this tab (so ui will benefit from this).
I'm open for any suggestions.